<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");

include("include/dbcommon.php");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); 

include("include/admin_rights_variables.php");


$gsqlHead="select `username` ";
$gsqlFrom="from `tbl_admin`";
$gsqlWhereExpr="";
$gsqlTail="";
// $gstrSQL = "SELECT TableName,   GroupID,   AccessMask  FROM phanquyen_ugrights ";
$gstrSQL = gSQLWhere("");


if(!@$_SESSION["UserID"])
{ 
	$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
	header("Location: login.php?message=expired"); 
	return;
}
if(!IsAdmin())
{
	echo "<p>"."You don't have permissions to access this table"." <a href=\"login.php\">"."Back to login page"."</a></p>";
	return;
}

include('include/xtempl.php');
include('classes/runnerpage.php');
include('classes/listpage.php');
include('classes/rightspage.php');
$xt = new Xtempl();



$options = array();
//array of params for classes
$options["pageType"] = PAGE_LIST;
$options["id"] = postvalue("id") ? postvalue("id") : 1;
$options["mode"] = RIGHTS_PAGE;
$options['xt'] = &$xt;
$nonAdminTablesRightsArr=array();
$nonAdminTablesArr=array();
$nonAdminTablesArr[] = array("tbl_admin","Tbl Admin");
$nonAdminTablesRightsArr["tbl_admin"]=array();
$nonAdminTablesArr[] = array("tbl_danh_muc_san_pham","Tbl Danh Muc San Pham");
$nonAdminTablesRightsArr["tbl_danh_muc_san_pham"]=array();
$nonAdminTablesArr[] = array("tbl_dich_vu","Tbl Dich Vu");
$nonAdminTablesRightsArr["tbl_dich_vu"]=array();
$nonAdminTablesArr[] = array("tbl_doi_tac_than_thien","Tbl Doi Tac Than Thien");
$nonAdminTablesRightsArr["tbl_doi_tac_than_thien"]=array();
$nonAdminTablesArr[] = array("tbl_fqas","Tbl Fqas");
$nonAdminTablesRightsArr["tbl_fqas"]=array();
$nonAdminTablesArr[] = array("tbl_gioi_thieu","Tbl Gioi Thieu");
$nonAdminTablesRightsArr["tbl_gioi_thieu"]=array();
$nonAdminTablesArr[] = array("tbl_lien_he","Tbl Lien He");
$nonAdminTablesRightsArr["tbl_lien_he"]=array();
$nonAdminTablesArr[] = array("tbl_lien_ket_web","Tbl Lien Ket Web");
$nonAdminTablesRightsArr["tbl_lien_ket_web"]=array();
$nonAdminTablesArr[] = array("tbl_san_pham","Tbl San Pham");
$nonAdminTablesRightsArr["tbl_san_pham"]=array();
$nonAdminTablesArr[] = array("tbl_san_pham_moi","Tbl San Pham Moi");
$nonAdminTablesRightsArr["tbl_san_pham_moi"]=array();
$nonAdminTablesArr[] = array("tbl_thong_tin_phong_ky_thuat","Tbl Thong Tin Phong Ky Thuat");
$nonAdminTablesRightsArr["tbl_thong_tin_phong_ky_thuat"]=array();
$nonAdminTablesArr[] = array("tbl_tin_tuc","Tbl Tin Tuc");
$nonAdminTablesRightsArr["tbl_tin_tuc"]=array();

$options["nonAdminTablesArr"] = $nonAdminTablesArr;
$options["nonAdminTablesRightsArr"] = $nonAdminTablesRightsArr;


$pageObject = ListPage::createListPage($strTableName, $options);
 // add button events if exist

// prepare code for build page
$pageObject->prepareForBuildPage();

// show page depends of mode
$pageObject->showPage();
	//$xt->assign_loopsection("grid_row",$rowinfo);
	


?>
